import type { PageLoad } from "./$types";
import { Align, type Column } from "@component/table";

const buildDatasetAnnotationCols = (): Column[] => {
  return [
    {
      key: "label",
      title: "简易标注",
      headAlign: Align.Left,
    },
    {
      key: "vote_cnt",
      width: 100,
      headAlign: Align.Center,
      title: "投票数",
      options: {
        align: Align.Center
      }
    },
  ];
};

export const load = (async ({ parent, params }) => {
  let data = await parent();
  return {
    title: data.menu_name || "数据集文件标注",
    entryAnnotationCols: buildDatasetAnnotationCols(),
    entryId: data.entry?.id || parseInt(params.entry_id)
  };
}) satisfies PageLoad;
